import React from 'react'
import {Input, Button, Icon} from 'antd'
import './index.less'

class Login extends React.Component {

  handleLoginClick = () => {
    sessionStorage.setItem("isLogin", true)
    const { history } = this.props
    history.push('/home/sub1')
  }

  render() {
    return (
      <div className="login login-bg">
        <div className="top">
          <span><Icon type="ant-design" /> Ant Design</span>
        </div>
        <div className="main">
          <div style={{marginBottom: 16}}>
            <Input addonBefore="Username" placeholder="UserName" />
          </div>
          <div style={{marginBottom: 16}}>
            <Input addonBefore="Password" placeholder="Password" />
          </div>
          <div className="login-btn">
            <Button type="primary" style={{width: 100}} onClick={this.handleLoginClick}>Login</Button>
          </div>
        </div>
      </div>
    )
  }
}

export default Login
